//路由的配置
import React from "react";

//路由懒加载
const Home = React.lazy(() => import("pages/Home"));
const Cart = React.lazy(() => import("pages/Cart"));
const Category = React.lazy(() => import("pages/Category"));
const Profile = React.lazy(() => import("pages/Profile"));
const Login = React.lazy(() => import("pages/Login"));
const ProductDetail = React.lazy(() => import("pages/Home/ProductDetail"));

//配置路由表
const routes = [
    { path: "/home", component: Home },
    { path: "/cart", component: Cart },
    { path: "/category", component: Category },
    { path: "/profile", component: Profile },
    { path: "/login", component: Login },
    { path: "/detail", component: ProductDetail },

    { from: "/", to: "/home" },
];

//输出
export default routes;
